<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ page import="java.util.*,com.orderMgr.bean.*"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title></title>

	</head>
	<body bgcolor="#FAFBE7"> 
		<center>
		<input type="hidden" id="orderSum"
			value="<%=request.getAttribute("orderSum")%>" />
		<form method="post">
			<div align="center">
				<table>
					<%
						List<OfFood> foods = (List<OfFood>) request.getAttribute("foods");
						for (int i = 0; i < foods.size(); i++) {
							OfFood of = foods.get(i);
							if (i % 4 == 0) {
					%>


					<tr>
						<%
							} else {
						%>
						<td>
							<!-- DDTO 查询出数据库中的菜单 -->

							<table border="1" cellpadding="1" cellspacing="1"
								bordercolor="#FAE6CE">
								<tr>
									<td rowspan="5" width="250pt" height="250">
										<img src="<%=basePath%>images/<%=of.getOfFoodPic()%>"
											width="200" height="250" />
									</td>
									<td>
										<%=of.getOfFoodName()%></td>
								</tr>
								<tr>
									<td>
										单价：<%=of.getOfFoodPrice()%></td>
								</tr>
								<%
						if (session.getAttribute("userName") != null) {
					%>
					<tr>
						<td>
							<input type="hidden" name="ofId" value="<%=of.getOfId()%>">
							<a href="userOrder.action?ofId=<%=of.getOfId()%>">点餐</a>
						</td>
					</tr>
					<%
						}
					%>
							</table>
						</td>

						<%
							}
								if (i % 4 == 3) {
						%>
					</tr>
					<%
						}
						}
					%>

					
				</table>

			</div>
		</form>
		</center>
	</body>
</html>